; DeclsInfo:Events

;EmitEvent ( Event_Id%, Event_X%, Event_Y%, Event_Data$ , Event_Source% ) : "_EmitEvent@20"
;PollEvent % ( ) : "_PollEvent@0"
;EventID % ( ) : "_EventID@0"
;EventX % ( ) : "_EventX@0"
;EventY % ( ) : "_EventY@0"
;EventSource % ( ) : "_EventSource@0"
;EventData $ ( ) : "_EventData@0"
;EventEnableStack ( enable% ) : "_EventEnableStack@4"
;EventStackEnabled % ( ) : "_EventStackEnabled@0"
;SetEventStackSize ( Size% ) : "_SetEventStackSize@4"
;EventStackSize % ( ) : "_EventStackSize@0"
;CountEvents % ( ) : "_CountEvents@0"


; ----------- Events ------------

Cls : Locate 0,0

EventEnableStack(True)
SetEventStackSize(5)

Print "stack size:"+EventStackSize%()+" Stack Enabled:"+EventStackEnabled()

For n= 1 To 10
	EmitEvent(n,400,300,"datas"+n, n*10)
Next

Print "Number of Events:"+CountEvents%()

While PollEvent()
	Select EventID()
		Case 6,7,8,9,10
			Print "polled: ID="+EventID()+" X="+EventX()+" Y="+EventY()+" source="+EventSource()+" data="+EventData()
		Default
			; You must set EventEnableStack(false) to show all events (no "flush")
			Print "This one won't print as the stack only register 5 events"
	End Select
Wend

FlushKeys():WaitKey()
End

;~IDEal Editor Parameters:
;~C#Blitz3D